package com.xyzwps.server.paimon.app.dto

import com.xyzwps.server.paimon.Regexps
import com.xyzwps.server.paimon.ext.validOrThrow
import com.xyzwps.server.paimon.value.Phone
import io.konform.validation.Validation
import io.konform.validation.constraints.pattern

data class LoginSendVcodeInput(
    val phone: Phone
) : ValidInput {
    companion object {
        val validator = Validation {
            LoginSendVcodeInput::phone {
//                pattern(Regexps.PHONE) TODO: 检查
            }
        }
    }

    override fun validateOrThrow() = validator.validOrThrow(this)
}